﻿    function changePasswordStart() {
        $("#validationsummary").hide();
        $("#validationsummary").text("");
        if (validate()) {
            $("#validationsummary").hide();
            $("#spinnermsg").text(" Saving...");
            $("#spinnermsg").show();
            $("#spinner").show();
            return true;
        }
        return false;
    }

    function changePasswordComplete() {
        if ($("#validationsummary").text() == "") {
            $("#spinnermsg").text("Saved");
            $("#spinnermsg").show();
        }
        else {
            $("#validationsummary").show();
        }
    }

    function validate() {
        if ($("#NewPassword").val() != $("#ConfirmPassword").val()) {
            $("#ConfirmPasswordMessage").text("The confirm password field must match the new password field.");
            $("#ConfirmPasswordMessage").css('color', '#ff0000');
            $("#ConfirmPassword").css('background', '#ffeeee');
            $("#ConfirmPassword").css('border', '1px solid #ff0000');
            return false;
        }
        else {
            return true;
        }
    }